export default defineEventHandler(event => {
  const {res,req} = event
  return `
  <!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">

  <meta content="ie=edge" http-equiv="X-UA-Compatible">
  <title>Document</title>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/axios/1.6.2/axios.min.js"></script>
  <link rel="stylesheet" href="">
</head>

<body>
<h1>B页面</h1>
<input class="input1" value="admin" type="text">
<br>
<br>
<input class="input2" value="admin" type="text">
<br>
<br>
<button class="login">登录</button>




<button class="data">请求鉴权资源</button>
<script>
  document.querySelector('.login').addEventListener('click',e => {
    axios({
      method:'post',
      url:'http://47.108.150.53:8000/user/login',
      data:{
        password: "admin",
        username: "admin",
      }
    }).then(({data:{data:{token}}}) => {
      localStorage.setItem('token',token)
      open('http://47.108.150.53/b')
    })
  })

</script>
</body>
</html>

  `
})
